#GLOB_RECURSE可向下查找嵌套目录，GLOB只能查找下一级目录
#CONFIGURE_DEPENDS自动检测目录是否更新,如果目录有新文件了，CMake 会自动帮你重新运行 cmake -B build 更新 myvar 变量。
#file(GLOB_RECURSE srcs CONFIGURE_DEPENDS src/*.cpp include/*.h)
#add_library(performance_monitoring STATIC ${srcs})
#target_include_directories(performance_monitoring PUBLIC include)


file(GLOB_RECURSE srcs CONFIGURE_DEPENDS src/*.cpp)
file(GLOB_RECURSE srcs_h CONFIGURE_DEPENDS include/*.h)
add_library(performance_monitoring SHARED ${srcs})
target_include_directories(performance_monitoring PUBLIC include) 

SET_TARGET_PROPERTIES(performance_monitoring PROPERTIES  OUTPUT_NAME "performance_monitoring")
SET_TARGET_PROPERTIES(performance_monitoring PROPERTIES CLEAN_DIRECT_OUTPUT 1)

# 文件放到该目录下
INSTALL(FILES ${srcs_h} DESTINATION /usr/hansan/include)

INSTALL(TARGETS performance_monitoring LIBRARY DESTINATION /usr/hansan/lib)